// Copyright (c) 2016 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// For lists of things like packages or projects
.hab-item-list {
  @include row;
  @include transition(all 0.6s);
  background-blend-mode: overlay;
  background-color: $white;
  border: 1px solid $light-gray;
  border-color: $hab-blue-light;
  border-radius: $global-radius;
  color: inherit;
  display: block;
  margin-bottom: 0.5em;
  padding: 1em 1.5em;
  position: relative;

  .count {
    @include primary-button;
    float: right;
    margin: auto $base-spacing * 2 0 auto;
  }

  .hab-gravatar {
    float: left;
    margin-right: 1em;
  }

  > h3 {
    margin-bottom: 0;
  }

  .pending & {
    background-color: $hab-off-white;

    h3 {
      color: $hab-gray;
    }
  }

  &--title,
  .item-title {
    @include span-columns(6);

    h3 {
      line-height: 1em;
      margin-bottom: 0;
      max-width: rem(300);
      text-overflow: ellipsis;
    }

    h4 {
      color: $hab-blue;
      font-size: 75%;
      margin-bottom: 0;
    }
  }

  &--controls {
    text-align: right;
  }

  &--info,
  .item-info {
    @include span-columns(6);
    padding-top: 0.5em;
    position: relative;

    img {
      @include transition(opacity 0.6s);
      height: 1.5em;
      opacity: 0.1;
      position: absolute;
      right: 0;
    }
  }

  &:hover,
  &.active {
    @include transform(scale(1.01));
    @include transition(all 0.2s ease-in-out);
    //border-color: $hab-blue;
    box-shadow: 0 1px 14px 0 $hab-blue-light;
  }

  li {
    &:last-child & {
      margin-bottom: 0;
    }
  }

  &.hab-no-select {
    &:hover {
      @include transform(none);
      @include transition(none);
      box-shadow: inherit;
      color: inherit;
      cursor: default;

      &.active {
        @include transform(scale(1.01));
        box-shadow: 0 1px 14px 0 $hab-blue-light;
      }
    }
  }

  &--all-link {
    padding: 0;

    h3 {
      margin-bottom: 0;
    }

    a {
      display: block;
      padding: 1em 1.5em;
    }
  }
}
